hr elements does not accept multiple classes #133
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @arve0,
after looking at the code more carefully, the issue discussed in #131 turns out to be in
markdown-it-attrs
. It's a very minor bug that only affects hr elements. I am working on a project that usesmarkdown-it-attrs
(Thank you 😃), hence putting up this PR to fix the issue at the root.This PR fixes #131
Like other elements, hr elements should also allow multiple
classes to be added. Currently, hr elements have a direct
assignment of attributes in patterns.js. Thus, multiple
class attributes are not combined into one.
By using the
utils.addAttrs
method, the attribute valueswill be merged correctly.
This bug fix helps with attributes on hr elements.
Example:
--- {.a .b}
Before:
<hr class='a' class='b'>
After:
<hr class='a b'>
PS:
I am not sure if I should update browser.js, please feel free to let me know if it needs to be done:)